package com.car.dal.dao.goods;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgPurchaseManage;
import com.car.util.Page;

import java.util.List;

/**
 * Created by AoSnow on 2017/5/10.
 */
public class TgPurchaseManageDaoImpl extends IbatisCommonDao<TgPurchaseManage, Integer> implements TgPurchaseManageDao {
    public GridObj GetList(TgPurchaseManage tgPurchaseManage, PageObj pageObj) {
        OrderObj order = new OrderObj();
        order.setDir("desc");
        order.setSort("id");
        return super.findByPage(tgPurchaseManage, pageObj, order);
    }

    @Override
    public Integer getTgPurchaseManageCount(TgPurchaseManage tgPurchaseManage) {
        return this.queryForInteger("getTgPurchaseManageCount", tgPurchaseManage);
    }

    @Override
    public List<TgPurchaseManage> getTgPurchaseManageList(TgPurchaseManage tgPurchaseManage, Page page) {
        tgPurchaseManage.setFirstrownum(page.getFirstrownum());
        tgPurchaseManage.setPagesize(page.getPagesize());
        List<TgPurchaseManage> list = this.queryForEntityList(TgPurchaseManage.class, "getTgPurchaseManageList", tgPurchaseManage);
        return list;
    }
}
